<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>机构</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css"/>
    <style>
        .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.7rem;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-tab-item {
            height: 2.4rem;
            line-height: 2.4rem;
            font-weight: bold;
            color: #333333;
            font-size: 17px;
        }

        .aui-tab-item.aui-active {
            color: #E73C5C;
            font-size: 17px;
            position: relative;
            border-bottom: none !important;
            font-weight: bold;
        }

        .sss {
            padding-left: 30%;
            padding-right: 30%;
            width: 100%;

        }

        body {
            background-color: #F5F5F5;
            padding-bottom: 3.35rem;
        }

        .title1 {
            background-color: #fff;
            width: 100%;
            padding: 0.75rem 0.75rem 0 0.8rem;
            display: flex;
        }

        .shu {
            width: 3px;
            height: 12px;
            background-color: #E73C5C;
            /*margin-top: 4px;*/
        }

        .font {
            font-size: 0.85rem;
            color: #333333;
            line-height: 0.6rem;
            margin-left: 0.3rem;
            font-weight: bold;
        }

        .warrp {
            width: 100%;
            padding: 0.8rem 1.5rem 0 0.8rem;
            background-color: #fff;
        }

        .cooc {
            width: 100%;
            height: 6.5rem;
            display: flex;
        }

        .header {
            width: 5rem;
            height: 5rem;
        }

        .header img {
            width: 100%;
            height: 100%;
        }

        .title {
            font-size: 0.75rem;
            color: #333333;
            line-height: 1.1rem;
            font-weight: bold;
        }

        .cont {
            font-size: 0.7rem;
            color: #666666;
            line-height: 0.85rem;
        }

        .aui-searchbar {
            display: -webkit-box;
            -webkit-box-pack: center;
            -webkit-box-align: center;
            height: 2.4rem;
            overflow: hidden;
            width: 100%;
            background-color: #ffffff;
            color: #9e9e9e;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .aui-searchbar-input {
            background-color: #ffffff;
            border-radius: 1rem;
            height: 30px;
            line-height: 30px;
            font-size: 0.7rem;
            position: relative;
            /*padding-left: 0.0rem;*/
            display: -webkit-box;
            -webkit-box-flex: 1;
            /*padding-right:1.0rem;*/
        }

        .aui-searchbar-input input {
            color: #999999;
            width: 100%;
            padding: 0;
            margin: 0;
            height: 1.5rem;
            line-height: normal;
            border: 0;
            -webkit-appearance: none;
            font-size: 0.7rem;
            background-color: #ffffff;
        }

        .aui-searchbar .aui-iconfont {
            line-height: 1.50rem;
            color: #9e9e9e !important;
        }

        .aaa {
            height: 1.5rem;
            line-height: 1.5rem;
            font-size: 13px;
            color: rgba(204, 204, 204, 1) !important;
            display: inline-block;
            vertical-align: top;
            margin-top: 0px;
        }

        .aui-icon-search:before {
            content: '';
            width: 15px;
            height: 1.50rem;
            background: url('__IMG__main1Search.png') no-repeat center center;
            background-size: 15px 15px;
            display: inline-block;
        }

        .aui-bar-nav .aui-title {
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            right: 0.75rem;
            left: 1.5rem;
            /* width: auto; */
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }

        .pposition {
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            /*right: 0.75rem;*/
            left: 0rem;
            width: 12rem;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }

        .pposition_left {
            float: left;
            width: 0.75rem;
            height: 0.7rem;
            margin-top: 0.85rem;
        }

        .eara {
            float: left;
            color: #4F3E37;
            font-size: 14px;
            margin: 0 0.2rem;
        }

        .right {
            flex: 1;
        }

        .pposition_right {
            float: left;
            width: 0.75rem;
            height: 0.7rem;
            margin-top: 0.85rem;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 49px;
            margin-top: 0.1rem;
            margin-right: 0.2rem;
        }

        .underNav {
            width: 100%;
            height: 2.4rem;
            position: fixed;
            bottom: 0;
            display: flex;
            justify-content: space-between;
            background-color: #fff;
            align-items: center;
            padding-left: 1.2rem;
            padding-right: 1.2rem;
            border-top: 1px solid #F6F6F6;
        }

        .kuai {
            display: flex;
            flex-flow: column;
            align-items: center;
        }

        .kuai img {
            width: 1.25rem;
            height: 1.25rem;
        }

        .Navfont {
            width: 100%;
            font-size: 0.55rem;
            font-weight: 400;
            color: #CCCCCC;
            text-align: center;
        }
        .Navfont1 {
            width: 100%;
            font-size: 0.55rem;
            font-weight: 400;
            color: rgba(231, 60, 92, 1);
            text-align: center;
        }
        .content11 {
            width: 13rem;
            margin: 0 auto 0;
            background-color: #fff;
            border-radius: 0.25rem;
        }

        .title11 {
            font-size: 15px;
            color: #000;
            padding-top: 1.225rem;
            padding-bottom: 0.975rem;
            text-align: center;
        }

        .tips11 {
            font-size: 13px;
            color: #B2B2B2;
            padding-bottom: 1.65rem;
            padding-left: 0.95rem;
            padding-right: 0.95rem;
        }

        .choose11 {
            height: 2.5rem;
            line-height: 2.5rem;
            text-align: center;
            font-size: 14px;
            color: #FB495D;
        }
    </style>
</head>

<body>
<div class="aui-bar aui-bar-nav" style="padding-top:25px;background-color:#FFFFFF;position:fixed;top:0;left:0;"
     id="header">
    <div class=" sss aui-tab bar nav" id="tab">
        <div class="aui-tab-item aui-active" onclick="fnMec(this)">机构</div>
        <div class="aui-tab-item" onclick="fnCorps(this)">总队</div>
    </div>
</div>
<div class="aui-searchbar" id="search" style="background-color:#F5F5F5;position:fixed;top:3.65rem;left:0;"
     onclick="openSearch()">
    <div class="aui-searchbar-input aui-border-radius">
        <div style="">
            <span class="aui-iconfont aui-icon-search"></span>
            <span class="aaa">输入机构名称</span>
        </div>
    </div>
</div>
<div class="title1" style="margin-top: 6.15rem;">
    <div class="shu"></div>
    <div class="font">我的机构</div>
</div>
{if $user_to_mechanism_id != -1 && $user_attestation == 3}
<div class="warrp" onclick="fnDetails(this)" tapmode='active' data-id="{$info.mechanism_id}">
    <div class="cooc">
        <div class="header">
            <img src="{$info.mechanism_logo}" alt="">
        </div>
        <div class="right" style="margin-left:0.8rem">
            <div class="title aui-ellipsis-2">
                {$info.mechanism_name}
            </div>
            <div class="cont aui-ellipsis-2" style="margin-top:0.5rem">
                {$info.mechanism_intro}
            </div>
        </div>
    </div>
</div>
{/if}

<div class="" style="margin-top:0.5rem"></div>
<div class="title1">
    <div class="shu"></div>
    <div class="font">全部机构</div>
</div>
<div class="upOrDown">
    <div class="upOrDown_data">
        {if(!empty($list))}
        {volist name='list' id='vo'}
        <div class="warrp" onclick="fnDetails(this)" data-id="{$vo.mechanism_id}">
            <div class="cooc underLine">
                <div class="header">
                    <img src="{$vo.mechanism_logo}" alt="">
                </div>
                <div class="right" style="margin-left:0.8rem">
                    <div class="title aui-ellipsis-2">
                        {$vo.mechanism_name}
                    </div>
                    <div class="cont aui-ellipsis-2" style="margin-top:0.5rem">
                        {$vo.mechanism_intro}
                    </div>
                </div>
            </div>
        </div>
        {/volist}
        {/if}
    </div>
</div>
<input type="hidden" name="user_to_mechanism_id" value="{$user_to_mechanism_id}">
<input type="hidden" name="user_attestation" value="{$user_attestation}">

<div class="flex-wrap flex-vertical" id="mask"
     style="display:none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0, 0, 0, 0.2);z-index: 100">
    <div class="flex-con" onclick="fnclose()" tapmode></div>
    <div class="content11">
        <div class="title11">加入机构</div>
        <div class="tips11">您当前还没有加入任何机构，快去找到自己的组织吧！</div>
        <div class="topLine2 choose11" onclick="fnclose()" tapmode>确定</div>
    </div>
    <div class="flex-con" onclick="fnclose()" tapmode></div>
</div>

<div class="underNav">
    <div class="kuai" onclick="opennew(1);">
        <img src="__IMG__nav/nav11.png" alt="">
        <div class="Navfont">首页</div>
    </div>
    <div class="kuai" onclick="opennew(2);">
        <img src="__IMG__nav/nav2.png" alt="">
        <div class="Navfont1">机构</div>
    </div>
    <div class="kuai" onclick="opennew(3);">
        <img src="__IMG__nav/nav33.png" alt="">
        <div class="Navfont">公益课堂</div>
    </div>
    <div class="kuai" onclick="opennew(4);">
        <img src="__IMG__nav/nav44.png" alt="">
        <div class="Navfont">知识库</div>
    </div>
    <div class="kuai" onclick="opennew(5);">
        <img src="__IMG__nav/nav55.png" alt="">
        <div class="Navfont">我的</div>
    </div>
</div>
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__aui-tab.js"></script>
<script type="text/javascript" src="__JS__doT.min.js"></script>
<script type="text/javascript" src="__JS__aui-lazyload.js"></script>
<script type="text/javascript">
    // 导航栏跳转
    function opennew(index) {
        if (index==1){
            location.href='{:url("First/index")}';
        } else if (index==2){
            location.href='{:url("Mechanism/index")}';
        } else if (index==3){
            location.href='{:url("Classroom/index")}';
        }else if (index==4){
            location.href='{:url("Information/index")}';
        }else if (index==5){
            location.href='{:url("My/index")}';
        }
    }
    window.onload = function () {
        var user_to_mechanism_id = $('input[name="user_to_mechanism_id"]').val();
        var user_attestation = $('input[name="user_attestation"]').val();
        if (user_to_mechanism_id == -1 || user_attestation != 3) {
            $("#mask").show()
        }
    }
    var page = 1;
    //机构详情
    function fnDetails(el) {
        var mechanism_id = $api.attr(el, 'data-id');
        location.href = '{:url("Mechanism/mechanismDetail")}?mechanism_id=' + mechanism_id;
    }
    //展示总队
    function fnCorps(el) {
        location.href = '{:url("Mechanism/corps")}';
    }

    //跳转搜索页面
    function openSearch() {
        location.href = '{:url("Mechanism/searchMec")}';
    }

    //关闭弹框
    function fnclose() {
        $('#mask').hide()
    }

    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea: window,
        autoLoad: true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn: function (me) {
            page++;
            $.ajax({
                url: '{:url("Mechanism/ajaxMechanism")}',
                data: 'page=' + page,//
                type: 'POST',
                dataType: 'JSON',
                success: function (data) {
                    var arrLen = data.msg.length;
                    if (arrLen <= 0) {

                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    } else {
                        var datas = data.msg;
                        $.each(datas, function (key, v) {
                            var _html = '';
                            _html += '<div class="warrp" onclick="fnDetails(this)" data-id=' + v.mechanism_id + '>';
                            _html += '<div class="cooc underLine">';
                            _html += '<div class="header"><img src=' + v.mechanism_logo + ' alt=""></div>';
                            _html += '<div class="right" style="margin-left:0.8rem">';
                            _html += '<div class="title aui-ellipsis-2">' + v.mechanism_name + '</div>';
                            _html += '<div class="cont aui-ellipsis-2" style="margin-top:0.5rem">' + v.mechanism_intro + '</div>';
                            _html += '</div></div></div>';
                            $(".upOrDown_data").append(_html);

                        });
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn: function (me) {
            page = 1;
            $.ajax({
                url: '{:url("Mechanism/ajaxMechanism")}',
                data: 'page=' + page,
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    $('.upOrDown_data').empty();//
                    var datas = data.msg;
                    $.each(datas, function (key, v) {
                        var _html = '';
                        _html += '<div class="warrp" onclick="fnDetails(this)" data-id=' + v.mechanism_id + '>';
                        _html += '<div class="cooc underLine">';
                        _html += '<div class="header"><img src=' + v.mechanism_logo + ' alt=""></div>';
                        _html += '<div class="right" style="margin-left:0.8rem">';
                        _html += '<div class="title aui-ellipsis-2">' + v.mechanism_name + '</div>';
                        _html += '<div class="cont aui-ellipsis-2" style="margin-top:0.5rem">' + v.mechanism_intro + '</div>';
                        _html += '</div></div></div>';
                        $(".upOrDown_data").append(_html);
                    });
                    me.resetload();
                    me.unlock();
                    me.noData(false);
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    me.resetload();
                }
            });
        }
    });
</script>

</html>
